const getTime=function(){
  return wx.cloud.callFunction({
    name:"get_time"
  }).then(res=>{
    let now=res.result.time;
    let date=new Date(now);
    console.log(date);
    const year = date.getFullYear();       // 获取年份
    const month = date.getMonth() + 1;       // 获取月份，注意月份从0开始，需要加1
    const day = date.getDate();              // 获取日期
    const hours = date.getHours();           // 获取小时
    const minutes = date.getMinutes();       // 获取分钟
    const seconds = date.getSeconds();       //获取秒
    let time={
      year:year,
      month:month,
      day:day,
      hours:hours,
      minutes:minutes,
      seconds:seconds
    }
    return time;
    
  }).catch(e=>{
    console.log(e);
  })
}
module.exports={
  getTime
}